<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>平台数据分析 - 管理后台</title>
    <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.6.0/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/font-awesome/5.15.3/css/all.min.css">
</head>
<body>
    <div th:replace="fragments/header :: navbar"></div>
    <div class="container mt-5">
        <h2 class="mb-4"><i class="fas fa-chart-bar"></i> 平台数据分析</h2>
        <div class="row mb-4">
            <div class="col-md-4">
                <div class="card text-center">
                    <div class="card-body">
                        <h5 class="card-title">订单总数</h5>
                        <p class="display-4" th:text="${orderCount}">0</p>
                    </div>
                </div>
            </div>
            <div class="col-md-4">
                <div class="card text-center">
                    <div class="card-body">
                        <h5 class="card-title">总交易金额</h5>
                        <p class="display-4 text-success" th:text="${totalAmount}">0.00</p>
                    </div>
                </div>
            </div>
        </div>
        <h4 class="mt-5">各类别交易量</h4>
        <table class="table table-bordered table-hover mt-3">
            <thead class="thead-light">
                <tr>
                    <th>类别</th>
                    <th>订单数量</th>
                </tr>
            </thead>
            <tbody>
                <tr th:each="stat : ${categoryStats}">
                    <td th:text="${stat.category}"></td>
                    <td th:text="${stat.orderCount}"></td>
                </tr>
            </tbody>
        </table>
    </div>
</body>
</html> 